package org.apache.schedule;

import org.apache.factory.Manager;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

@Component
public class MainJob implements InitializingBean {

    @Autowired
    private ApplicationContext ctx;

    @Override
    public void afterPropertiesSet() throws Exception {

        Manager manager = (Manager) ctx.getBean(Manager.class);
        manager.start();

    }
}
